home *** CD-ROM | disk | FTP | other *** search
/ Headbone Interactive / Headbone_Interactive_CD-ROM_Sampler_1995.iso / pc / demos / abf / mainxyz.dxr / 00159_main movie scripts.ls < prev    next >
Encoding:
Text File  |  1995-09-15  |  16.2 KB  |  474 lines

  1. on startMovie
  2.   global gvPhotoSprite, gvMaskSprite, gvOverlaySprite, gvLetterMaskSprite, gvAlphaStripSprite, gvAlphaHiliteBoxSprite, gvHiliteLetterSprite, gvToolBarSprite, gvQuitButtonSprite, gvHelpButtonSprite, gvChgPhotoButton1Sprite, gvChgPhotoButton2Sprite, gvChgPhotoButton3Sprite, gvChgTrackButtonSprite, gvActivity1ButtonSprite, gvActivity2ButtonSprite, gvWordSprite1, gvWordSprite2, gvWordSprite3, gvLabelSprite, gvaPhoto, up, down, right, left, SFX_EXT, MOV_EXT, DIR_SYM, IBM, OVERLAY_DELAY, PHOTO_DELAY, gvfRhymeTrack, gvfPhotoSFX, gvfFromIntro, gvfRealQuit, gvCurLetter, gvTicks, gvRhymeTime, gvcPPButtSounds, gvcSFButtSounds, gvcFFFButtSounds, gvSeekFindLetters, gvPokeProdLetters, gvfDidWhoDoesWhat, gMouseDownTimer
  3.   set the mouseDownScript to EMPTY
  4.   set the mouseUpScript to EMPTY
  5.   set the keyDownScript to EMPTY
  6.   set the timeoutScript to EMPTY
  7.   set up to 0
  8.   set down to 1
  9.   set right to 2
  10.   set left to 3
  11.   set IBM to 256
  12.   if voidp(SFX_EXT) then
  13.     set SFX_EXT to ".AIF"
  14.   end if
  15.   if voidp(MOV_EXT) then
  16.     set MOV_EXT to ".dxr"
  17.   end if
  18.   if the machineType = IBM then
  19.     if voidp(DIR_SYM) then
  20.       set DIR_SYM to "\"
  21.     end if
  22.     setAt(the searchPath, 1, the pathName & "SFX")
  23.   else
  24.     if voidp(DIR_SYM) then
  25.       set DIR_SYM to ":"
  26.     end if
  27.   end if
  28.   set the timer to the lastClick
  29.   set gMouseDownTimer to the lastClick
  30.   set OVERLAY_DELAY to 900
  31.   set PHOTO_DELAY to 150
  32.   set gvcPPButtSounds to 7
  33.   set gvcSFButtSounds to 6
  34.   set gvcFFFButtSounds to 12
  35.   set gvSeekFindLetters to "Y"
  36.   set gvPokeProdLetters to "XZ"
  37.   set gvfDidWhoDoesWhat to 0
  38.   set gvPhotoSprite to 1
  39.   set gvMaskSprite to 2
  40.   set gvOverlaySprite to 3
  41.   set gvWordSprite1 to 4
  42.   set gvWordSprite2 to 5
  43.   set gvWordSprite3 to 6
  44.   set gvLabelSprite to 7
  45.   set gvLetterMaskSprite to 13
  46.   set gvToolBarSprite to 14
  47.   set gvAlphaStripSprite to 15
  48.   set gvAlphaHiliteBoxSprite to 16
  49.   set gvQuitButtonSprite to 17
  50.   set gvChgTrackButtonSprite to 18
  51.   set gvActivity1ButtonSprite to 19
  52.   set gvActivity2ButtonSprite to 20
  53.   set gvChgPhotoButton1Sprite to 21
  54.   set gvChgPhotoButton2Sprite to 22
  55.   set gvChgPhotoButton3Sprite to 23
  56.   set gvHelpButtonSprite to 24
  57.   set gvHiliteLetterSprite to 26
  58.   if the frame = label("Init") then
  59.     if gvfFromIntro then
  60.       set gvfFromIntro to 0
  61.     else
  62.       set gvfRhymeTrack to 1
  63.     end if
  64.     if gvfRhymeTrack then
  65.       set gvRhymeTime to OVERLAY_DELAY
  66.     else
  67.       set gvRhymeTime to PHOTO_DELAY
  68.     end if
  69.     if ("XYZ" contains gvCurLetter) = 0 then
  70.       set gvCurLetter to "X"
  71.     end if
  72.     set gvfPhotoSFX to 0
  73.     set gvfRealQuit to 0
  74.     set gvTicks to 0
  75.     set gvaPhoto to fArray(mnew, 26)
  76.     initPhotos()
  77.   else
  78.     initMovie()
  79.     updatePhoto(gvCurLetter, "b")
  80.     updateStage()
  81.     set gvTicks to 0
  82.     updateInterface()
  83.     updateStage()
  84.   end if
  85.   set the keyDownScript to "checkKeyForQuit"
  86.   set the exitLock to 1
  87. end
  88.  
  89. on stopMovie
  90.   global gvPhotoSprite, gvLabelSprite, gvAlphaHiliteBoxSprite, gvActivity1ButtonSprite, gvActivity2ButtonSprite, gvHiliteLetterSprite, gvChgTrackButtonSprite, gvQuitButtonSprite, gvHelpButtonSprite, gvChgPhotoButton1Sprite, gvChgPhotoButton2Sprite, gvChgPhotoButton3Sprite, gvfRealQuit, gvaPhoto
  91.   set the puppet of sprite gvPhotoSprite to 0
  92.   set the puppet of sprite gvLabelSprite to 0
  93.   set the puppet of sprite gvQuitButtonSprite to 0
  94.   set the puppet of sprite gvAlphaHiliteBoxSprite to 0
  95.   set the puppet of sprite gvChgPhotoButton1Sprite to 0
  96.   set the puppet of sprite gvChgPhotoButton2Sprite to 0
  97.   set the puppet of sprite gvChgPhotoButton3Sprite to 0
  98.   set the puppet of sprite gvActivity1ButtonSprite to 0
  99.   set the puppet of sprite gvActivity2ButtonSprite to 0
  100.   set the puppet of sprite gvChgTrackButtonSprite to 0
  101.   set the puppet of sprite gvHelpButtonSprite to 0
  102.   set the stretch of sprite gvChgPhotoButton1Sprite to 0
  103.   set the stretch of sprite gvChgPhotoButton2Sprite to 0
  104.   set the stretch of sprite gvChgPhotoButton3Sprite to 0
  105.   if gvfRealQuit then
  106.     gvaPhoto(mdispose)
  107.   end if
  108.   set the keyDownScript to EMPTY
  109.   set the mouseDownScript to EMPTY
  110.   set the mouseUpScript to EMPTY
  111. end
  112.  
  113. on idle
  114.   checkForTop20()
  115.   set the mouseDownScript to "mouseDownHandler"
  116.   set the mouseUpScript to "mouseUpHandler"
  117.   cursor(0)
  118. end
  119.  
  120. on initPhotos
  121.   global gvaPhoto
  122.   repeat with vLetter = 1 to 26
  123.     gvaPhoto(mput, vLetter, 1)
  124.   end repeat
  125. end
  126.  
  127. on getLetterAtMarker vMarker
  128.   repeat with vAscii = charToNum("A") to charToNum("Z")
  129.     set vLetter to numToChar(vAscii)
  130.     if marker(vMarker) = label(vLetter) then
  131.       exit repeat
  132.     end if
  133.   end repeat
  134.   return vLetter
  135. end
  136.  
  137. on updatePhoto vLetter, vType
  138.   global gvPhotoSprite, gvaPhoto
  139.   set vLetterNum to charToNum(vLetter) - charToNum("A") + 1
  140.   set vWhichPhoto to gvaPhoto(mget, vLetterNum)
  141.   set vCastName to vLetter & "Photo" & vWhichPhoto & vType & ".pic"
  142.   if the number of cast vCastName = -1 then
  143.     set vCastName to vLetter & "Photo" & "1" & vType & ".pic"
  144.     if the number of cast vCastName = -1 then
  145.       set vCastName to vLetter & "Photo" & vWhichPhoto & "b" & ".pic"
  146.       if the number of cast vCastName = -1 then
  147.         set vCastName to vLetter & "Photo" & "1" & "b" & ".pic"
  148.       end if
  149.     end if
  150.   end if
  151.   if the number of cast vCastName <> -1 then
  152.     set the castNum of sprite gvPhotoSprite to the number of cast vCastName
  153.   end if
  154. end
  155.  
  156. on updateSwapPhotoButtons
  157.   global gvCurLetter, gvChgPhotoButton1Sprite, gvChgPhotoButton2Sprite, gvChgPhotoButton3Sprite
  158.   repeat with vPhotoNum = 1 to 3
  159.     set vCastName to gvCurLetter & "Photo" & string(vPhotoNum) & "a" & ".pic"
  160.     if the number of cast vCastName = -1 then
  161.       set vCastName to gvCurLetter & "Photo" & string(vPhotoNum) & "b" & ".pic"
  162.     end if
  163.     if vPhotoNum = 1 then
  164.       set the castNum of sprite gvChgPhotoButton1Sprite to the number of cast vCastName
  165.       next repeat
  166.     end if
  167.     if vPhotoNum = 2 then
  168.       set the castNum of sprite gvChgPhotoButton2Sprite to the number of cast vCastName
  169.       next repeat
  170.     end if
  171.     if vPhotoNum = 3 then
  172.       set the castNum of sprite gvChgPhotoButton3Sprite to the number of cast vCastName
  173.     end if
  174.   end repeat
  175. end
  176.  
  177. on hideInterface
  178.   global gvAlphaStripSprite, gvToolBarSprite, gvAlphaHiliteBoxSprite, gvActivity1ButtonSprite, gvActivity2ButtonSprite, gvHiliteLetterSprite, gvChgTrackButtonSprite, gvQuitButtonSprite, gvHelpButtonSprite
  179.   set the visible of sprite gvQuitButtonSprite to 0
  180.   set the visible of sprite gvAlphaHiliteBoxSprite to 0
  181.   set the visible of sprite gvActivity1ButtonSprite to 0
  182.   set the visible of sprite gvActivity2ButtonSprite to 0
  183.   set the visible of sprite gvChgTrackButtonSprite to 0
  184.   set the visible of sprite gvAlphaStripSprite to 0
  185.   set the visible of sprite gvToolBarSprite to 0
  186.   set the visible of sprite gvHelpButtonSprite to 0
  187.   set the visible of sprite gvHiliteLetterSprite to 0
  188.   hideSwapPhotoButtons()
  189. end
  190.  
  191. on waitCheckMouse vTicks, vfMouse
  192.   if vfMouse then
  193.     wait(vTicks)
  194.   else
  195.     waitNoMouse(vTicks)
  196.   end if
  197. end
  198.  
  199. on wait vTicks
  200.   set vTime to the timer
  201.   repeat while the timer < (vTime + vTicks)
  202.     if the mouseDown then
  203.       exit repeat
  204.     end if
  205.   end repeat
  206. end
  207.  
  208. on waitNoMouse vTicks
  209.   set vTime to the timer
  210.   repeat while the timer < (vTime + vTicks)
  211.     nothing()
  212.   end repeat
  213. end
  214.  
  215. on updateInterface
  216.   global gvAlphaStripSprite, gvToolBarSprite, gvAlphaHiliteBoxSprite, gvActivity1ButtonSprite, gvActivity2ButtonSprite, gvHiliteLetterSprite, gvChgPhotoButton1Sprite, gvChgPhotoButton2Sprite, gvChgPhotoButton3Sprite, gvChgTrackButtonSprite, gvQuitButtonSprite, gvLabelSprite, gvHelpButtonSprite, gvfRhymeTrack, gvCurLetter
  217.   set vLetNum to charToNum(gvCurLetter) - charToNum("A")
  218.   set the locH of sprite gvAlphaHiliteBoxSprite to (vLetNum * 21) + 30
  219.   set the visible of sprite gvQuitButtonSprite to 1
  220.   set the visible of sprite gvAlphaHiliteBoxSprite to 1
  221.   set the visible of sprite gvActivity1ButtonSprite to 1
  222.   set the visible of sprite gvActivity2ButtonSprite to 1
  223.   set the visible of sprite gvChgTrackButtonSprite to 1
  224.   set the visible of sprite gvAlphaStripSprite to 1
  225.   set the visible of sprite gvToolBarSprite to 1
  226.   set the visible of sprite gvHelpButtonSprite to 1
  227.   set the visible of sprite gvHiliteLetterSprite to 0
  228.   if gvfRhymeTrack then
  229.     hideSwapPhotoButtons()
  230.     set the visible of sprite gvLabelSprite to 0
  231.     set the castNum of sprite gvChgTrackButtonSprite to the number of cast "PhoButt1.pic"
  232.     set the castNum of sprite gvActivity1ButtonSprite to the number of cast "S&FButt1.pic"
  233.     set the castNum of sprite gvActivity2ButtonSprite to the number of cast "P&PButt1.pic"
  234.     set the locH of sprite gvActivity1ButtonSprite to 380
  235.     set the locH of sprite gvChgTrackButtonSprite to 208
  236.     showCallOuts()
  237.   else
  238.     set the visible of sprite gvChgPhotoButton1Sprite to 1
  239.     set the visible of sprite gvChgPhotoButton2Sprite to 1
  240.     set the visible of sprite gvChgPhotoButton3Sprite to 1
  241.     set the castNum of sprite gvChgTrackButtonSprite to the number of cast "LetButt1.pic"
  242.     set the castNum of sprite gvActivity1ButtonSprite to getPhotoActivityButton()
  243.     set the castNum of sprite gvActivity2ButtonSprite to the number of cast "SwapButt.pic"
  244.     set the locH of sprite gvActivity1ButtonSprite to 327
  245.     set the locH of sprite gvChgTrackButtonSprite to 184
  246.     updateSwapPhotoButtons()
  247.     hideCallOuts()
  248.   end if
  249. end
  250.  
  251. on flashRedLetter
  252.   global gvHiliteLetterSprite, gvCurLetter, gvAlphaStripSprite
  253.   if the visible of sprite gvAlphaStripSprite = 1 then
  254.     set the castNum of sprite gvHiliteLetterSprite to the number of cast ("red" & gvCurLetter)
  255.     set the visible of sprite gvHiliteLetterSprite to 1
  256.     updateStage()
  257.     wait(15)
  258.     set the visible of sprite gvHiliteLetterSprite to 0
  259.     updateStage()
  260.   end if
  261. end
  262.  
  263. on handleClickInAlphabetStrip vMouseH, vMouseV
  264.   global gvCurLetter, gvAlphabetStrip, gvfRhymeTrack, gvfPhotoSFX, gvAlphaHiliteBoxSprite, DIR_SYM, SFX_EXT
  265.   set vLetter to (vMouseH - 16) / 21
  266.   if (vLetter >= 23) and (vLetter <= 25) then
  267.     set the locH of sprite gvAlphaHiliteBoxSprite to (vLetter * 21) + 30
  268.     updateStage()
  269.     repeat while the stillDown
  270.       set vLetter to (the mouseH - 16) / 21
  271.       if vLetter < 23 then
  272.         set vLetter to 23
  273.       end if
  274.       if vLetter > 25 then
  275.         set vLetter to 25
  276.       end if
  277.       set the locH of sprite gvAlphaHiliteBoxSprite to (vLetter * 21) + 30
  278.       updateStage()
  279.     end repeat
  280.     set vLetter to numToChar(charToNum("A") + vLetter)
  281.     if vLetter <> gvCurLetter then
  282.       set gvCurLetter to vLetter
  283.       updateInterface()
  284.       flashRedLetter()
  285.       if gvfRhymeTrack then
  286.         set vFileName to "Letter" & gvCurLetter & SFX_EXT
  287.         puppetSound(vFileName)
  288.       end if
  289.       updateStage()
  290.       goToLetter(vLetter)
  291.       if gvfRhymeTrack = 0 then
  292.         set gvfPhotoSFX to 0
  293.         handlePhotoToggle()
  294.       end if
  295.     end if
  296.   end if
  297. end
  298.  
  299. on goToNextLetter
  300.   global gvCurLetter, gvfRhymeTrack
  301.   if gvCurLetter = "Z" then
  302.     set vLetter to "X"
  303.   else
  304.     set vLetter to numToChar(charToNum(gvCurLetter) + 1)
  305.   end if
  306.   goToLetter(vLetter)
  307. end
  308.  
  309. on goToLetter vLetter
  310.   global gvCurLetter, gvfRhymeTrack, gvTicks, IBM, gvPhotoSprite
  311.   updatePhoto(vLetter, "b")
  312.   set gvCurLetter to vLetter
  313.   if gvfRhymeTrack then
  314.     go(label(vLetter & "STOP"))
  315.   else
  316.     go(label("PHOTO"))
  317.   end if
  318. end
  319.  
  320. on playSoundTrack
  321.   global gvfRhymeTrack, gvCurLetter, SFX_EXT
  322.   if gvfRhymeTrack then
  323.     set vCastName to gvCurLetter & "Rhyme1" & SFX_EXT
  324.     puppetSound(vCastName)
  325.     updateStage()
  326.   end if
  327. end
  328.  
  329. on doWordCallOuts
  330.   global gvWordSprite1, gvWordSprite2, gvWordSprite3, gvActivity2ButtonSprite, gvCurLetter, gvRhymeTime, gvTicks
  331.   hideCallOuts()
  332.   updateStage()
  333.   set vfMouseDown to 0
  334.   set vCount to 1
  335.   set vWaitTime to 0
  336.   repeat with vSprite = gvWordSprite1 to gvWordSprite3
  337.     if vWaitTime then
  338.       set vCharSprite to getOverlayRhymeSprite()
  339.       if vCharSprite = gvActivity2ButtonSprite then
  340.         set vfMouseDown to animateChar(vCharSprite, 12, 4, vWaitTime, 1)
  341.       else
  342.         set vfMouseDown to animateChar(vCharSprite, 10, 3, vWaitTime, 1)
  343.       end if
  344.     end if
  345.     if vfMouseDown then
  346.       sound stop 1
  347.       exit repeat
  348.     end if
  349.     set the visible of sprite vSprite to 1
  350.     updateStage()
  351.     if vCount = 1 then
  352.       set vWaitTime to 375
  353.     else
  354.       set vWaitTime to 325
  355.     end if
  356.     set vCount to vCount + 1
  357.   end repeat
  358.   showCallOuts()
  359.   updateStage()
  360. end
  361.  
  362. on hideSwapPhotoButtons
  363.   global gvChgPhotoButton1Sprite, gvChgPhotoButton2Sprite, gvChgPhotoButton3Sprite
  364.   set the visible of sprite gvChgPhotoButton1Sprite to 0
  365.   set the visible of sprite gvChgPhotoButton2Sprite to 0
  366.   set the visible of sprite gvChgPhotoButton3Sprite to 0
  367.   set the castNum of sprite gvChgPhotoButton1Sprite to the number of cast "HideSprite"
  368.   set the castNum of sprite gvChgPhotoButton2Sprite to the number of cast "HideSprite"
  369.   set the castNum of sprite gvChgPhotoButton3Sprite to the number of cast "HideSprite"
  370. end
  371.  
  372. on hideCallOuts
  373.   global gvWordSprite1, gvWordSprite2, gvWordSprite3
  374.   set the visible of sprite gvWordSprite1 to 0
  375.   set the visible of sprite gvWordSprite2 to 0
  376.   set the visible of sprite gvWordSprite3 to 0
  377. end
  378.  
  379. on showCallOuts
  380.   global gvWordSprite1, gvWordSprite2, gvWordSprite3
  381.   set the visible of sprite gvWordSprite1 to 1
  382.   set the visible of sprite gvWordSprite2 to 1
  383.   set the visible of sprite gvWordSprite3 to 1
  384. end
  385.  
  386. on handlePhotoToggle
  387.   global gvfRhymeTrack, gvfPhotoSFX, gvCurLetter, gvaPhoto, gvLabelSprite, SFX_EXT, DIR_SYM, gvActivity1ButtonSprite
  388.   set vfMouseDown to 0
  389.   if gvfRhymeTrack = 0 then
  390.     set vLetterNum to charToNum(gvCurLetter) - charToNum("A") + 1
  391.     set vWhichPhoto to gvaPhoto(mget, vLetterNum)
  392.     if gvfPhotoSFX then
  393.       set vFileName to gvCurLetter & "Sound" & string(vWhichPhoto) & SFX_EXT
  394.       puppetSound(vFileName)
  395.       updateStage()
  396.       set gvfPhotoSFX to 0
  397.     else
  398.       set the visible of sprite gvLabelSprite to 1
  399.       set the stretch of sprite gvLabelSprite to 0
  400.       set vCastName to gvCurLetter & ".pic"
  401.       set the castNum of sprite gvLabelSprite to the number of cast vCastName
  402.       updateStage()
  403.       set vFileName to gvCurLetter & string(vWhichPhoto) & SFX_EXT
  404.       puppetSound(vFileName)
  405.       updateStage()
  406.       if the name of cast the castNum of sprite gvActivity1ButtonSprite contains "FFFButt" then
  407.         set vfMouseDown to animateChar(gvActivity1ButtonSprite, 10, 4, 10, 1)
  408.       else
  409.         set vfMouseDown to animateChar(gvActivity1ButtonSprite, 10, 3, 10, 1)
  410.       end if
  411.       if vfMouseDown then
  412.         sound stop 1
  413.       else
  414.         set vTime to the timer + 20
  415.         if gvCurLetter = "X" then
  416.           set vCastName to gvCurLetter & "1" & ".pic"
  417.         else
  418.           set vCastName to gvCurLetter & string(vWhichPhoto) & ".pic"
  419.         end if
  420.         preLoadCast(vCastName)
  421.         repeat while the timer < vTime
  422.           if the mouseDown then
  423.             set vfMouseDown to 1
  424.             exit repeat
  425.           end if
  426.         end repeat
  427.         if vfMouseDown = 0 then
  428.           set the castNum of sprite gvLabelSprite to the number of cast vCastName
  429.           set vTime to the timer + 60
  430.           if the name of cast the castNum of sprite gvActivity1ButtonSprite contains "FFFButt" then
  431.             set vfMouseDown to animateChar(gvActivity1ButtonSprite, 10, 4, 0, 1)
  432.           else
  433.             set vfMouseDown to animateChar(gvActivity1ButtonSprite, 10, 3, 0, 1)
  434.           end if
  435.           repeat while the timer < vTime
  436.             if the mouseDown or vfMouseDown then
  437.               set vfMouseDown to 1
  438.               exit repeat
  439.             end if
  440.           end repeat
  441.         end if
  442.       end if
  443.       set the visible of sprite gvLabelSprite to 0
  444.       updateStage()
  445.       set gvfPhotoSFX to 1
  446.     end if
  447.   end if
  448. end
  449.  
  450. on doTransition
  451.   global gvOverlaySprite, gvMaskSprite, gvLetterMaskSprite, gvRhymeTime, gvfRhymeTrack, gvCurLetter, OVERLAY_DELAY, PHOTO_DELAY
  452.   if gvfRhymeTrack then
  453.     set gvfRhymeTrack to 0
  454.     set the visible of sprite gvOverlaySprite to 0
  455.     set the visible of sprite gvMaskSprite to 0
  456.     set the visible of sprite gvLetterMaskSprite to 0
  457.     updateInterface()
  458.     puppetTransition(23, 1, 20, 1)
  459.     go(label("PHOTO"))
  460.     set gvRhymeTime to PHOTO_DELAY
  461.   else
  462.     set gvfRhymeTrack to 1
  463.     set the visible of sprite gvOverlaySprite to 1
  464.     set the visible of sprite gvMaskSprite to 1
  465.     set the visible of sprite gvLetterMaskSprite to 1
  466.     updateInterface()
  467.     puppetTransition(23, 1, 20, 1)
  468.     go(label(gvCurLetter & "STOP"))
  469.     set gvRhymeTime to OVERLAY_DELAY
  470.   end if
  471. end
  472.  
  473. factory fArray
  474.